# this Makefile will demostrate how to use this meta-programming tool, argParser
all: py cpp tclap

py: template.py test.py
	@echo "--- argParser generate Python snippet ---"
	./argParser python template.py > py_args_include
	./test.py -h -n 10 -i abc r1 r2 r3 r3
	@echo

cpp: template.cpp  test.cpp
	@echo "--- argParser generate C++ snippet ---"
	./argParser cpp template.cpp > cpp_args_include
	g++ -o test test.cpp
	./test -H -n 10 -i abc r1 r2 r3 r3
	@echo

tclap: template.cpp  test_tclap.cpp
	@echo "--- argParser generate TCLAP snippet ---"
	./argParser tclap template.cpp > tclap_args_include 
	test -d tclap-1.2.0 && g++ -Itclap-1.2.0/include -o tclap_test test_tclap.cpp || echo "TCLAP not installed"
	test -f ./tclap_test && ./tclap_test -i fad -n 1238 adf adfiapsd
	@echo


dist: 
	test -d release || mkdir release
	cd ./release && hg clone https://cmdparse.googlecode.com/hg/ cmdparse && tar zvcf cmdparse_`date +%m%d%Y`.tar.gz *
.PHONY: dist

clean:
	-rm py_args_include tclap_args_include test tclap_test
	-rm *~
	[ ! -d cmdp ] && rm -rf release

